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U7B,EAAYI,MAAM,CAC5BF,aAAcA,EACdC,OAAQA,YAEPJ,GAAc+B,CAAAA,EAAAA,EAAAA,CAAAA,EAAQ/B,EAAYD,GAClCA,MAAAA,EAAAA,KAAAA,EAAAA,EAAiBiC,GAAG,CAAC,CAACC,EAASC,IAC9B,GAAAV,EAAAW,GAAA,EAACC,EAAAA,CAAqBA,CAAAA,CAEpBH,QAASA,GADJ,WAAaI,MAAA,CAAFH,KAInBhC,GAAiB,GAAAsB,EAAAW,GAAA,EAACG,EAAAA,CAAYA,CAAAA,CAAE,GAAGpC,EAAcG,MAAM,KAG9D","sources":["webpack://_N_E/?ab2a","webpack://_N_E/./pages/baskast/[slug].tsx","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/baskast/[slug]\",\n function () {\n return require(\"private-next-pages/baskast/[slug].tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/baskast/[slug]\"])\n });\n }\n ","import safeStringify from \"fast-safe-stringify\";\n\nimport { GetStaticPaths, GetStaticProps, NextPage } from \"next\";\n\nimport { useEffect } from \"react\";\n\nimport { ContentfulNavigation } from \"../../@types/contentfulNavigation\";\nimport { IPageFields } from \"../../@types/generated/contentful\";\nimport { getHero } from \"../../app/[slug]/component\";\nimport ContentSectionWrapper from \"../../components/content-section-wrapper\";\nimport CountdownBar from \"../../components/countdown-bar\";\nimport PageLayout from \"../../components/page/layout\";\nimport getContentfulContentTypeEntries from \"../../utils/contentful/getContentfulContentTypeEntries\";\nimport getContentfulPage from \"../../utils/contentful/getContentfulPage\";\nimport generateTitle from \"../../utils/page/generateTitle\";\nimport getJointPageProperties, {\n JointPageProperties,\n} from \"../../utils/page/getJointPageProperties\";\nimport { BAS_KAST_TENANT_NAME } from \"../../utils/tenant-names\";\nimport { isBasKastTenantPage } from \"../../utils/tenants\";\n\ninterface PageProps {\n isPreview?: boolean;\n page: IPageFields;\n previewData?: any;\n navigation: ContentfulNavigation;\n jointPageProperties: JointPageProperties;\n}\n\n/**\n * Top level page\n * @param {PageProps} props\n * @param {IPageFields} props.page\n * @returns JSX.Element\n */\nconst Page: NextPage = ({\n isPreview,\n page,\n previewData,\n navigation,\n jointPageProperties,\n}: PageProps) => {\n const {\n contentSections,\n heroTeaser,\n seoMetadata,\n countdownPage,\n noNavigation,\n tenant,\n } = page;\n const {\n fields: { title },\n } = seoMetadata;\n const { footerProps } = jointPageProperties;\n const {\n logoDark,\n logoLight,\n titleSuffix,\n bannerVisible,\n bannerText,\n bannerIcon,\n } = jointPageProperties.siteSettings;\n\n useEffect(() => {\n if (isPreview && previewData?.internal !== \"\") {\n const previewElement = document.getElementById(previewData.internal);\n if (previewElement) {\n previewElement.scrollIntoView({ behavior: \"smooth\" });\n }\n }\n }, [isPreview, previewData.internal]);\n\n const fullTitle = generateTitle(title, titleSuffix);\n\n return (\n \n {heroTeaser && getHero(heroTeaser, contentSections)}\n {contentSections?.map((section, i) => (\n \n ))}\n {countdownPage && }\n \n );\n};\n\nexport default Page;\n\n/**\n * This function gets called at build time to pre-fetch the routes of the course pages\n * @returns {Promise<{paths: {params: {slug: string}}[], fallback: boolean}>}\n */\nexport const getStaticPaths: GetStaticPaths = async () => {\n // Call contentful API endpoint to get course pages\n const pages = await getContentfulContentTypeEntries({\n contentType: \"page\",\n filter: {\n \"fields.tenant\": \"baskast\",\n \"fields.isRecipe[ne]\": \"true\",\n },\n }).then((entries) => entries.items.map((entry) => entry.fields));\n\n // Filter out tenant pages\n const filteredPages = pages.filter((page) => isBasKastTenantPage(page));\n\n // Get the paths we want to pre-render based on the pages\n const paths = filteredPages.map((page) => ({\n params: {\n slug: page.slug,\n },\n }));\n\n // We'll pre-render only these paths at build time.\n // { fallback: false } means other routes should 404.\n return { paths, fallback: false };\n};\n\n/**\n * This function gets called at build time on server-side to statically pre-fetch the data for the page\n * @param {GetStaticPropsContext} context\n * @returns page data\n */\nexport const getStaticProps: GetStaticProps = async (context) => {\n const [page, jointPageProperties] = await Promise.all([\n getContentfulPage({\n // get page slug from context\n slug: context.params?.slug?.toString() || \"\",\n isPreview: context.preview || false,\n previewData: context.previewData,\n }),\n getJointPageProperties(context, BAS_KAST_TENANT_NAME),\n ]);\n\n // if no page was found, return 404\n if (!page) {\n return { notFound: true };\n }\n\n const propsData = safeStringify({\n page: page.fields,\n isPreview: context.preview || false,\n previewData: context.previewData || {\n env: process.env.NEXT_PUBLIC_CONTENTFUL_ENV,\n internal: \"\",\n },\n navigation: jointPageProperties.navigation,\n jointPageProperties,\n theme: BAS_KAST_TENANT_NAME,\n });\n\n const props = JSON.parse(propsData);\n\n // pass page data to the page via props\n return {\n props,\n };\n};\n"],"names":["window","__NEXT_P","push","__webpack_require__","__webpack_exports__","isPreview","page","previewData","navigation","jointPageProperties","param","contentSections","heroTeaser","seoMetadata","countdownPage","noNavigation","tenant","fields","title","footerProps","logoDark","logoLight","titleSuffix","bannerVisible","bannerText","bannerIcon","siteSettings","useEffect","internal","previewElement","document","getElementById","scrollIntoView","behavior","fullTitle","generateTitle","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","PageLayout","footer","logoHeader","logoFooter","metadata","getHero","map","section","i","jsx","ContentSectionWrapper","concat","CountdownBar"],"sourceRoot":""}